package com.atguigu.gmall.cart.service;

import com.atguigu.gmall.model.cart.CartInfo;
import com.atguigu.gmall.model.product.SkuInfo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface CartService {

    String determinCartKey(HttpServletRequest request);

    /**
     * 获取用户购物车的key
     * @param request
     * @return
     */
    String userCartKey(HttpServletRequest request);

    /**
     * 获取临时购物车的key
     * @param request
     * @return
     */
    String tempCartKey(HttpServletRequest request);

    CartInfo addToCart(String key, Long skuId, Integer skuNum);


    List<CartInfo> listCart(String tempCartKey, String userCartKey);

    void ajaxCheckCart(String key, Long skuId, Integer checked);

    void ajaxDeleteCart(String key, Long skuId);

    List<CartInfo> getListCheckCartInfo(HttpServletRequest request);


    void ajaxDeleteCartItemBatch(String key, List<String> skuIds);
}
